#!/usr/bin/env python
# coding: utf-8

# In[1]:


from multiprocessing import Process
import os
import time

# 定义子进程函数
def run_proc(name):
    start = time.time()
    print('run child process %s (%s)...' %(name, os.getpid()))
    time.sleep(2)
    end = time.time()
    print(end - start)

if __name__ == '__main__':
    print('parent process %s' % os.getpid())
    p = Process(target=run_proc, args=('test', ))
    print('child process will start')
    p.start()
    p.join()
    print('child process end')


# In[ ]:





# In[ ]:





# In[ ]:




